Bitcoin CLI JSON RPC API Call reference – ChainQuery

NEM community subreddit

NEM (New Economy Movement) is a dual-layer blockchain with 100% original source code. Launched on March 31, 2015, the NEM mainnet supports multiple ledgers on its cryptocurrency layer, and the NEM Smart Assets layer supports mosaics to represent any asset. NEM’s proprietary coin is XEM, which is harvested (mined) using a Proof-of-Importance (PoI) algorithm. This community is for discussions regarding the blockchain platform.
[link]

New Ethereum Developer Course

Hey All! We've been working heads down on a new developer curriculum for the last year. We're excited to announce it's finally here.
This curriculum is composed primarily of in-browser coding tutorials and challenges (no need to install any dependencies!). It also includes videos and guides which will help you apply what you learned in your local development environment when you're done with the course.
The full course includes:
Learning JavaScript: A collection of JavaScript coding tutorials and challenges which thoroughly teach JS from scratch with the latest ECMAScript features. Networking: Writing Asynchronous Code and communicating with servers through APIs Data Structures: Building and understanding data structures that are important to blockchain programming (especially trees and linked lists) Blockchain: Understanding Bitcoin, Proof-Of-Work, Digital Signatures and building core blockchain data structures. As well as learning about Ethereum, the EVM, ethers.js, and the Ethereum Node JSON-RPC API. Smart Contracts: Our largest section! This includes 21 coding tutorials and challenges thoroughly teaching the latest Solidity version 0.6.x from the very basics. Decentralized Applications: Deploy Smart Contracts and interact with them through ethers.js. You'll have three new working decentralized applications at the end of this section which you'll be able to extend upon to build bigger projects!
You can find the full listing here: https://www.chainshot.com/curriculum
The course is available through a monthly subscription. We'll also be starting live coding classes next month for all subscribers!
We hope you'll choose to learn with us. Let us know if you have any questions/concerns. All feedback is welcome. :)
submitted by dan-nolan to ethdev [link] [comments]

ETHEREUM FRONTEND JAVASCRIPT APIS: WHAT YOU NEED TO KNOW

ETHEREUM FRONTEND JAVASCRIPT APIS: WHAT YOU NEED TO KNOW

https://preview.redd.it/9djdo90nx9051.jpg?width=2400&format=pjpg&auto=webp&s=54ca700da20bac0692ed294a31e75cfefb96f671
Blockchain has emerged as a popular technology, and if you are planning to make a career in this field, then there are various certification programs. When we talk about Blockchain, then it becomes important to mention about Ethereum. It is a cryptocurrency and an open-source platform as well. There has been some great development in this field, and those who are planning to learn about Ethereum must go for a certified Ethereum course.
Blockchain developers who are developing apps on Ethereum must know about the different frontend javascript which can simplify their task. In this blog, we will be highlight three such popular javascript APIs.
Ethereum Overview:
Ethereum emerged after Bitcoin and has now become a popular Blockchain platform. It is a cryptocurrency as well. It is an open-source software platform. Ethereum offers a flexible platform to the developer so that they can develop decentralized apps with ease.
Although scalability is a bit of an issue with Ethereum, in the current scenario, it is one of the best platforms for decentralized application development.
Looking at the broader spectrum and use of Blockchain, it has become a great career opportunity for many. Hence, option for certified Blockchain Developer is the right way to give your career the right boost.
What is API?
API is a set of the protocol which is used of building and integrating the applications across different platforms. APIs eventually simplifies app development and enables seamless interaction of your products and services with the user.
Popular frontend Javascript APIs:
Web3.js- This is a collection of libraries which empowers you to connect with remote Ethereum node. It is achieved by using HTTP or IPC connection. This is used for the following :

  1. Send ether from one account to another
  2. Interact with smart contracts
  3. Retrieve user account
It interacts with Ethereum Blockchain with JSON RPC protocol. A copy of all the data and code is present on the Blockchain. The API requests an individual Ethereum node with JSON RPC to read and write data to the network.
Ethers.js
Another frontend javascript is Ethere.js, which is used by most of the decentralized application developers owing to its features and functionalities. It has the following main features:

  1. It is open source
  2. It is completely safe as it keeps private keys restricted to the clients
  3. You can import and export using JSON wallets which again adds to the security feature
  4. Import and export BIP 39 mnemonic phrases
  5. You can connect to Ethereum nodes via JSON-RPC, MetaMask, INFURA, or Etherscan.
  6. It is completely TypeScript ready
  7. It offers complete functionality for all Ethereym needs
  8. Extensive documentation
  9. It has a huge collection of test cases
  10. It has an MIT Licence.
If you are looking for another API to develop javascript with Ethereum, then you must consider Ether.js. It is loaded with features that any Blockchain developer would require. The library is designed in such a way that it matches the need of the client. With the use of ether.js, it becomes easier to write javascript-based wallets.
Light.js
The third entrant in our list is light.js. It provides high-level tools which are used for developing efficient Dapps on the light client. This is also a great alternative to web3.js. It works with remote nodes and makes it easy for a developer to build decentralized applications with ease.
Here it becomes important to mention that light.js chooses the best pattern which works with light clients, it listens to headers and makes API calls on a new header an ensures that network calls are not extreme.
The end objective is to put up a high-level library such that the decentralized app developers can make use of this and create apps.
Besides, these there are other APIs like Web3-wrapper can also be used by blockchain developer. These APIs aim to simplify the task of the developer so that they can create apps which work seamlessly.
Final Thoughts
If you are working on a decentralized application developed, then you would come across either of these apps or will be using one of them. In case you are new to this field and are looking for gaining comprehensive knowledge in this field, then you must go for a Certified Ethereum Expert online training program by Blockchain Council. This exhaustive program will help you learn about Ethereum, APIs and allied concepts and at the same time, learn how to use them. In case you want to learn how to use smart contracts on Ethereum based applications, then you must opt for Certified Solidity Developer coursesby Blockchain Council. Connect with us today to explore more about Ethereum.
submitted by Blockchain_org to BlockchainStartups [link] [comments]

Project Design Help! Ideas much appreciated!

Hello pythonistas,
I'm graduate student and working on a research project about getting insights from tweets and analyzing them. But I stuck and need a hand. Short info about my programming knowledge, I can read and understand the code though not able to develop mine without tutorials. I think that clarifies which level am I at.
So lately, I watched a tutorial about Twitter Sentiment Analysis made by LucidProgramming(Thanks to him!) and I came across to a crossroad. I'm able make search queries on Twitter API and print the tweet blobs on terminal but can't go any further. What I planned to do, in simple manner, getting 30 days of tweets about 'bitcoin' search query and then later analyzing sentiments of these tweets. In order acquire these, how should I design and deploy my script? My questions are:

1) Do I need deploy this script to a platform such as Heroku or something since it needs to be run 7/24 in order to get tweets from twitter and push to database?(Btw I have free Github Education pack, most of the premium applications are free)
2) Which database would fit my needs in means of ease of use for beginners and handling high amounts of tweets?(I don't know how many tweets I would get but let's say 100k tweets in total for 30 days)
MySQL, PostgreSQL, MongoDB, SQLite or others. Afaik SQLite is not recommended if you deploy your script on server right? Or would rather say other solutions like json or xml(maybe more easier for beginner like me) formatted storage methods?

3) Or would you recommend me to just forget about deploying this script to a server and run on my own computer since free Twitter API doesn't allow users to make queries about tweet updates older than 7 days. In short, would be better to just run the script at the end of each every upcoming day and store the tweets?(I think this is a completely silly idea since it clashes with programming mentality)
Or if you know more straightforward and easy solution about it, please let me know!
Thanks in advance. Your help will be much appreciated!
Cheers!
Code:
from tweepy import OAuthHandler from tweepy.streaming import StreamListener from tweepy import Stream from tweepy import API from tweepy import Cursor import twitter_credentials import numpy as np import pandas as pd # Class for authentication class TwitterAuthenticator(): def authenticate_twitter_app(self): auth = OAuthHandler(twitter_credentials.CONSUMER_KEY, twitter_credentials.CONSUMER_SECRET) auth.set_access_token(twitter_credentials.ACCESS_TOKEN, twitter_credentials.ACCESS_TOKEN_SECRET) return auth # A basic listener class that just prints received tweets to stdout. class TwitterListener(StreamListener): def __init__(self, fetched_tweets_filename): self.fetched_tweets_filename = fetched_tweets_filename def on_data(self, data): try: print(data) with open(self.fetched_tweets_filename, 'a') as tf: tf.write(data) return True except BaseException as e: print("Error on_data: %s" % str(e)) return True def on_error(self, status): if status == 420: # Returning False on_data method in case rate limits occurs return False print(status) # Class for streaming and processing live tweets. class TwitterStreamer(): def __init__(self): self.twitter_authenticator = TwitterAuthenticator() def stream_tweets(self, fetched_tweets_filename, hash_tag_list): # This handles Twitter authentication and the connection to the Twitter Streaming API listener = TwitterListener(fetched_tweets_filename) auth = self.twitter_authenticator.authenticate_twitter_app() stream = Stream(auth, listener) stream.filter(track=hash_tag_list) # Class turning our script to a Client class TwitterClient(): def __init__(self): self.auth = TwitterAuthenticator().authenticate_twitter_app() self.twitter_client = API(self.auth) def filter_specific_tweets(self, q, lang, count, until, num_tweets): filtered_tweets = [] for tweet in Cursor(self.twitter_client.search, q=q, lang=lang, count=count, until=until).items(num_tweets): filtered_tweets.append(tweet) return filtered_tweets if __name__ == "__main__": hash_tag_list = ["barack oboma", "donald trump"] fetched_tweets_filename = "tweets.json" #twitter_streamer = TwitterStreamer() #twitter_streamer.stream_tweets(fetched_tweets_filename, hash_tag_list) q = 'bitcoin' lang = 'en' #geocode = '51.507496,-0.127285,20km' count = 100 until = '2020-05-04' num_tweets = 5 twitter_client = TwitterClient() print(twitter_client.filter_specific_tweets(q, lang, count, until, num_tweets)) 
submitted by salbayrak to learnpython [link] [comments]

FlowCards: A Declarative Framework for Development of Ergo dApps

FlowCards: A Declarative Framework for Development of Ergo dApps
Introduction
ErgoScript is the smart contract language used by the Ergo blockchain. While it has concise syntax adopted from Scala/Kotlin, it still may seem confusing at first because conceptually ErgoScript is quite different compared to conventional languages which we all know and love. This is because Ergo is a UTXO based blockchain, whereas smart contracts are traditionally associated with account based systems like Ethereum. However, Ergo's transaction model has many advantages over the account based model and with the right approach it can even be significantly easier to develop Ergo contracts than to write and debug Solidity code.
Below we will cover the key aspects of the Ergo contract model which makes it different:
Paradigm
The account model of Ethereum is imperative. This means that the typical task of sending coins from Alice to Bob requires changing the balances in storage as a series of operations. Ergo's UTXO based programming model on the other hand is declarative. ErgoScript contracts specify conditions for a transaction to be accepted by the blockchain (not changes to be made in the storage state as result of the contract execution).
Scalability
In the account model of Ethereum both storage changes and validity checks are performed on-chain during code execution. In contrast, Ergo transactions are created off-chain and only validation checks are performed on-chain thus reducing the amount of operations performed by every node on the network. In addition, due to immutability of the transaction graph, various optimization strategies are possible to improve throughput of transactions per second in the network. Light verifying nodes are also possible thus further facilitating scalability and accessibility of the network.
Shared state
The account-based model is reliant on shared mutable state which is known to lead to complex semantics (and subtle million dollar bugs) in the context of concurrent/ distributed computation. Ergo's model is based on an immutable graph of transactions. This approach, inherited from Bitcoin, plays well with the concurrent and distributed nature of blockchains and facilitates light trustless clients.
Expressive Power
Ethereum advocated execution of a turing-complete language on the blockchain. It theoretically promised unlimited potential, however in practice severe limitations came to light from excessive blockchain bloat, subtle multi-million dollar bugs, gas costs which limit contract complexity, and other such problems. Ergo on the flip side extends UTXO to enable turing-completeness while limiting the complexity of the ErgoScript language itself. The same expressive power is achieved in a different and more semantically sound way.
With the all of the above points, it should be clear that there are a lot of benefits to the model Ergo is using. In the rest of this article I will introduce you to the concept of FlowCards - a dApp developer component which allows for designing complex Ergo contracts in a declarative and visual way.

From Imperative to Declarative

In the imperative programming model of Ethereum a transaction is a sequence of operations executed by the Ethereum VM. The following Solidity function implements a transfer of tokens from sender to receiver . The transaction starts when sender calls this function on an instance of a contract and ends when the function returns.
// Sends an amount of existing coins from any caller to an address function send(address receiver, uint amount) public { require(amount <= balances[msg.sender], "Insufficient balance."); balances[msg.sender] -= amount; balances[receiver] += amount; emit Sent(msg.sender, receiver, amount); } 
The function first checks the pre-conditions, then updates the storage (i.e. balances) and finally publishes the post-condition as the Sent event. The gas which is consumed by the transaction is sent to the miner as a reward for executing this transaction.
Unlike Ethereum, a transaction in Ergo is a data structure holding a list of input coins which it spends and a list of output coins which it creates preserving the total balances of ERGs and tokens (in which Ergo is similar to Bitcoin).
Turning back to the example above, since Ergo natively supports tokens, therefore for this specific example of sending tokens we don't need to write any code in ErgoScript. Instead we need to create the ‘send’ transaction shown in the following figure, which describes the same token transfer but declaratively.
https://preview.redd.it/sxs3kesvrsv41.png?width=1348&format=png&auto=webp&s=582382bc26912ff79114d831d937d94b6988e69f
The picture visually describes the following steps, which the network user needs to perform:
  1. Select unspent sender's boxes, containing in total tB >= amount of tokens and B >= txFee + minErg ERGs.
  2. Create an output target box which is protected by the receiver public key with minErg ERGs and amount of T tokens.
  3. Create one fee output protected by the minerFee contract with txFee ERGs.
  4. Create one change output protected by the sender public key, containing B - minErg - txFee ERGs and tB - amount of T tokens.
  5. Create a new transaction, sign it using the sender's secret key and send to the Ergo network.
What is important to understand here is that all of these steps are preformed off-chain (for example using Appkit Transaction API) by the user's application. Ergo network nodes don't need to repeat this transaction creation process, they only need to validate the already formed transaction. ErgoScript contracts are stored in the inputs of the transaction and check spending conditions. The node executes the contracts on-chain when the transaction is validated. The transaction is valid if all of the conditions are satisfied.
Thus, in Ethereum when we “send amount from sender to recipient” we are literally editing balances and updating the storage with a concrete set of commands. This happens on-chain and thus a new transaction is also created on-chain as the result of this process.
In Ergo (as in Bitcoin) transactions are created off-chain and the network nodes only verify them. The effects of the transaction on the blockchain state is that input coins (or Boxes in Ergo's parlance) are removed and output boxes are added to the UTXO set.
In the example above we don't use an ErgoScript contract but instead assume a signature check is used as the spending pre-condition. However in more complex application scenarios we of course need to use ErgoScript which is what we are going to discuss next.

From Changing State to Checking Context

In the send function example we first checked the pre-condition (require(amount <= balances[msg.sender],...) ) and then changed the state (i.e. update balances balances[msg.sender] -= amount ). This is typical in Ethereum transactions. Before we change anything we need to check if it is valid to do so.
In Ergo, as we discussed previously, the state (i.e. UTXO set of boxes) is changed implicitly when a valid transaction is included in a block. Thus we only need to check the pre-conditions before the transaction can be added to the block. This is what ErgoScript contracts do.
It is not possible to “change the state” in ErgoScript because it is a language to check pre-conditions for spending coins. ErgoScript is a purely functional language without side effects that operates on immutable data values. This means all the inputs, outputs and other transaction parameters available in a script are immutable. This, among other things, makes ErgoScript a very simple language that is easy to learn and safe to use. Similar to Bitcoin, each input box contains a script, which should return the true value in order to 1) allow spending of the box (i.e. removing from the UTXO set) and 2) adding the transaction to the block.
If we are being pedantic, it is therefore incorrect (strictly speaking) to think of ErgoScript as the language of Ergo contracts, because it is the language of propositions (logical predicates, formulas, etc.) which protect boxes from “illegal” spending. Unlike Bitcoin, in Ergo the whole transaction and a part of the current blockchain context is available to every script. Therefore each script may check which outputs are created by the transaction, their ERG and token amounts (we will use this capability in our example DEX contracts), current block number etc.
In ErgoScript you define the conditions of whether changes (i.e. coin spending) are allowed to happen in a given context. This is in contrast to programming the changes imperatively in the code of a contract.
While Ergo's transaction model unlocks a whole range of applications like (DEX, DeFi Apps, LETS, etc), designing contracts as pre-conditions for coin spending (or guarding scripts) directly is not intuitive. In the next sections we will consider a useful graphical notation to design contracts declaratively using FlowCard Diagrams, which is a visual representation of executable components (FlowCards).
FlowCards aim to radically simplify dApp development on the Ergo platform by providing a high-level declarative language, execution runtime, storage format and a graphical notation.
We will start with a high level of diagrams and go down to FlowCard specification.

FlowCard Diagrams

The idea behind FlowCard diagrams is based on the following observations: 1) An Ergo box is immutable and can only be spent in the transaction which uses it as an input. 2) We therefore can draw a flow of boxes through transactions, so that boxes flowing in to the transaction are spent and those flowing out are created and added to the UTXO. 3) A transaction from this perspective is simply a transformer of old boxes to the new ones preserving the balances of ERGs and tokens involved.
The following figure shows the main elements of the Ergo transaction we've already seen previously (now under the name of FlowCard Diagram).
https://preview.redd.it/06aqkcd1ssv41.png?width=1304&format=png&auto=webp&s=106eda730e0526919aabd5af9596b97e45b69777
There is a strictly defined meaning (semantics) behind every element of the diagram, so that the diagram is a visual representation (or a view) of the underlying executable component (called FlowCard).
The FlowCard can be used as a reusable component of an Ergo dApp to create and initiate the transaction on the Ergo blockchain. We will discuss this in the coming sections.
Now let's look at the individual pieces of the FlowCard diagram one by one.
1. Name and Parameters
Each flow card is given a name and a list of typed parameters. This is similar to a template with parameters. In the above figure we can see the Send flow card which has five parameters. The parameters are used in the specification.
2. Contract Wallet
This is a key element of the flow card. Every box has a guarding script. Often it is the script that checks a signature against a public key. This script is trivial in ErgoScript and is defined like the def pk(pubkey: Address) = { pubkey } template where pubkey is a parameter of the type Address . In the figure, the script template is applied to the parameter pk(sender) and thus a concrete wallet contract is obtained. Therefore pk(sender) and pk(receiver) yield different scripts and represent different wallets on the diagram, even though they use the same template.
Contract Wallet contains a set of all UTXO boxes which have a given script derived from the given script template using flow card parameters. For example, in the figure, the template is pk and parameter pubkey is substituted with the `sender’ flow card parameter.
3. Contract
Even though a contract is a property of a box, on the diagram we group the boxes by their contracts, therefore it looks like the boxes belong to the contracts, rather than the contracts belong to the boxes. In the example, we have three instantiated contracts pk(sender) , pk(receiver) and minerFee . Note, that pk(sender) is the instantiation of the pk template with the concrete parameter sender and minerFee is the instantiation of the pre-defined contract which protects the miner reward boxes.
4. Box name
In the diagram we can give each box a name. Besides readability of the diagram, we also use the name as a synonym of a more complex indexed access to the box in the contract. For example, change is the name of the box, which can also be used in the ErgoScript conditions instead of OUTPUTS(2) . We also use box names to associate spending conditions with the boxes.
5. Boxes in the wallet
In the diagram, we show boxes (darker rectangles) as belonging to the contract wallets (lighter rectangles). Each such box rectangle is connected with a grey transaction rectangle by either orange or green arrows or both. An output box (with an incoming green arrow) may include many lines of text where each line specifies a condition which should be checked as part of the transaction. The first line specifies the condition on the amount of ERG which should be placed in the box. Other lines may take one of the following forms:
  1. amount: TOKEN - the box should contain the given amount of the given TOKEN
  2. R == value - the box should contain the given value of the given register R
  3. boxName ? condition - the box named boxName should check condition in its script.
We discuss these conditions in the sections below.
6. Amount of ERGs in the box
Each box should store a minimum amount of ERGs. This is checked when the creating transaction is validated. In the diagram the amount of ERGs is always shown as the first line (e.g. B: ERG or B - minErg - txFee ). The value type ascription B: ERG is optional and may be used for readability. When the value is given as a formula, then this formula should be respected by the transaction which creates the box.
It is important to understand that variables like amount and txFee are not named properties of the boxes. They are parameters of the whole diagram and representing some amounts. Or put it another way, they are shared parameters between transactions (e.g. Sell Order and Swap transactions from DEX example below share the tAmt parameter). So the same name is tied to the same value throughout the diagram (this is where the tooling would help a lot). However, when it comes to on-chain validation of those values, only explicit conditions which are marked with ? are transformed to ErgoScript. At the same time, all other conditions are ensured off-chain during transaction building (for example in an application using Appkit API) and transaction validation when it is added to the blockchain.
7. Amount of T token
A box can store values of many tokens. The tokens on the diagram are named and a value variable may be associated with the token T using value: T expression. The value may be given by formula. If the formula is prefixed with a box name like boxName ? formula , then it is should also be checked in the guarding script of the boxName box. This additional specification is very convenient because 1) it allows to validate the visual design automatically, and 2) the conditions specified in the boxes of a diagram are enough to synthesize the necessary guarding scripts. (more about this below at “From Diagrams To ErgoScript Contracts”)
8. Tx Inputs
Inputs are connected to the corresponding transaction by orange arrows. An input arrow may have a label of the following forms:
  1. [email protected] - optional name with an index i.e. [email protected] or u/2 . This is a property of the target endpoint of the arrow. The name is used in conditions of related boxes and the index is the position of the corresponding box in the INPUTS collection of the transaction.
  2. !action - is a property of the source of the arrow and gives a name for an alternative spending path of the box (we will see this in DEX example)
Because of alternative spending paths, a box may have many outgoing orange arrows, in which case they should be labeled with different actions.
9. Transaction
A transaction spends input boxes and creates output boxes. The input boxes are given by the orange arrows and the labels are expected to put inputs at the right indexes in INPUTS collection. The output boxes are given by the green arrows. Each transaction should preserve a strict balance of ERG values (sum of inputs == sum of outputs) and for each token the sum of inputs >= the sum of outputs. The design diagram requires an explicit specification of the ERG and token values for all of the output boxes to avoid implicit errors and ensure better readability.
10. Tx Outputs
Outputs are connected to the corresponding transaction by green arrows. An output arrow may have a label of the following [email protected] , where an optional name is accompanied with an index i.e. [email protected] or u/2 . This is a property of the source endpoint of the arrow. The name is used in conditions of the related boxes and the index is the position of the corresponding box in the OUTPUTS collection of the transaction.

Example: Decentralized Exchange (DEX)

Now let's use the above described notation to design a FlowCard for a DEX dApp. It is simple enough yet also illustrates all of the key features of FlowCard diagrams which we've introduced in the previous section.
The dApp scenario is shown in the figure below: There are three participants (buyer, seller and DEX) of the DEX dApp and five different transaction types, which are created by participants. The buyer wants to swap ergAmt of ERGs for tAmt of TID tokens (or vice versa, the seller wants to sell TID tokens for ERGs, who sends the order first doesn't matter). Both the buyer and the seller can cancel their orders any time. The DEX off-chain matching service can find matching orders and create the Swap transaction to complete the exchange.
The following diagram fully (and formally) specifies all of the five transactions that must be created off-chain by the DEX dApp. It also specifies all of the spending conditions that should be verified on-chain.

https://preview.redd.it/piogz0v9ssv41.png?width=1614&format=png&auto=webp&s=e1b503a635ad3d138ef91e2f0c3b726e78958646
Let's discuss the FlowCard diagram and the logic of each transaction in details:
Buy Order Transaction
A buyer creates a Buy Order transaction. The transaction spends E amount of ERGs (which we will write E: ERG ) from one or more boxes in the pk(buyer) wallet. The transaction creates a bid box with ergAmt: ERG protected by the buyOrder script. The buyOrder script is synthesized from the specification (see below at “From Diagrams To ErgoScript Contracts”) either manually or automatically by a tool. Even though we don't need to define the buyOrder script explicitly during designing, at run time the bid box should contain the buyOrder script as the guarding proposition (which checks the box spending conditions), otherwise the conditions specified in the diagram will not be checked.
The change box is created to make the input and output sums of the transaction balanced. The transaction fee box is omitted because it can be added automatically by the tools. In practice, however, the designer can add the fee box explicitly to the a diagram. It covers the cases of more complex transactions (like Swap) where there are many ways to pay the transaction fee.
Cancel Buy, Cancel Sell Transactions
At any time, the buyer can cancel the order by sending CancelBuy transaction. The transaction should satisfy the guarding buyOrder contract which protects the bid box. As you can see on the diagram, both the Cancel and the Swap transactions can spend the bid box. When a box has spending alternatives (or spending paths) then each alternative is identified by a unique name prefixed with ! (!cancel and !swap for the bid box). Each alternative path has specific spending conditions. In our example, when the Cancel Buy transaction spends the bid box the ?buyer condition should be satisfied, which we read as “the signature for the buyer address should be presented in the transaction”. Therefore, only buyer can cancel the buy order. This “signature” condition is only required for the !cancel alternative spending path and not required for !swap .
Sell Order Transaction
The Sell Order transaction is similar to the BuyOrder in that it deals with tokens in addition to ERGs. The transaction spends E: ERG and T: TID tokens from seller's wallet (specified as pk(seller) contract). The two outputs are ask and change . The change is a standard box to balance transaction. The ask box keeps tAmt: TID tokens for the exchange and minErg: ERG - the minimum amount of ERGs required in every box.
Swap Transaction
This is a key transaction in the DEX dApp scenario. The transaction has several spending conditions on the input boxes and those conditions are included in the buyOrder and sellOrder scripts (which are verified when the transaction is added to the blockchain). However, on the diagram those conditions are not specified in the bid and ask boxes, they are instead defined in the output boxes of the transaction.
This is a convention for improved usability because most of the conditions relate to the properties of the output boxes. We could specify those properties in the bid box, but then we would have to use more complex expressions.
Let's consider the output created by the arrow labeled with [email protected] . This label tells us that the output is at the index 0 in the OUTPUTS collection of the transaction and that in the diagram we can refer to this box by the buyerOut name. Thus we can label both the box itself and the arrow to give the box a name.
The conditions shown in the buyerOut box have the form bid ? condition , which means they should be verified on-chain in order to spend the bid box. The conditions have the following meaning:
  • tAmt: TID requires the box to have tAmt amount of TID token
  • R4 == bid.id requires R4 register in the box to be equal to id of the bid box.
  • script == buyer requires the buyerOut box to have the script of the wallet where it is located on the diagram, i.e. pk(buyer)
Similar properties are added to the sellerOut box, which is specified to be at index 1 and the name is given to it using the label on the box itself, rather than on the arrow.
The Swap transaction spends two boxes bid and ask using the !swap spending path on both, however unlike !cancel the conditions on the path are not specified. This is where the bid ? and ask ? prefixes come into play. They are used so that the conditions listed in the buyerOut and sellerOut boxes are moved to the !swap spending path of the bid and ask boxes correspondingly.
If you look at the conditions of the output boxes, you will see that they exactly specify the swap of values between seller's and buyer's wallets. The buyer gets the necessary amount of TID token and seller gets the corresponding amount of ERGs. The Swap transaction is created when there are two matching boxes with buyOrder and sellOrder contracts.

From Diagrams To ErgoScript Contracts

What is interesting about FlowCard specifications is that we can use them to automatically generate the necessary ErgoTree scripts. With the appropriate tooling support this can be done automatically, but with the lack of thereof, it can be done manually. Thus, the FlowCard allows us to capture and visually represent all of the design choices and semantic details of an Ergo dApp.
What we are going to do next is to mechanically create the buyOrder contract from the information given in the DEX flow card.
Recall that each script is a proposition (boolean valued expression) which should evaluate to true to allow spending of the box. When we have many conditions to be met at the same time we can combine them in a logical formula using the AND binary operation, and if we have alternatives (not necessarily exclusive) we can put them into the OR operation.
The buyOrder box has the alternative spending paths !cancel and !swap . Thus the ErgoScript code should have OR operation with two arguments - one for each spending path.
/** buyOrder contract */ { val cancelCondition = {} val swapCondition = {} cancelCondition || swapCondition } 
The formula for the cancelCondition expression is given in the !cancel spending path of the buyOrder box. We can directly include it in the script.
/** buyOrder contract */ { val cancelCondition = { buyer } val swapCondition = {} cancelCondition || swapCondition } 
For the !swap spending path of the buyOrder box the conditions are specified in the buyerOut output box of the Swap transaction. If we simply include them in the swapCondition then we get a syntactically incorrect script.
/** buyOrder contract */ { val cancelCondition = { buyer } val swapCondition = { tAmt: TID && R4 == bid.id && @contract } cancelCondition || swapCondition } 
We can however translate the conditions from the diagram syntax to ErgoScript expressions using the following simple rules
  1. [email protected] ==> val buyerOut = OUTPUTS(0)
  2. tAmt: TID ==> tid._2 == tAmt where tid = buyerOut.tokens(TID)
  3. R4 == bid.id ==> R4 == SELF.id where R4 = buyerOut.R4[Coll[Byte]].get
  4. script == buyer ==> buyerOut.propositionBytes == buyer.propBytes
Note, in the diagram TID represents a token id, but ErgoScript doesn't have access to the tokens by the ids so we cannot write tokens.getByKey(TID) . For this reason, when the diagram is translated into ErgoScript, TID becomes a named constant of the index in tokens collection of the box. The concrete value of the constant is assigned when the BuyOrder transaction with the buyOrder box is created. The correspondence and consistency between the actual tokenId, the TID constant and the actual tokens of the buyerOut box is ensured by the off-chain application code, which is completely possible since all of the transactions are created by the application using FlowCard as a guiding specification. This may sound too complicated, but this is part of the translation from diagram specification to actual executable application code, most of which can be automated.
After the transformation we can obtain a correct script which checks all the required preconditions for spending the buyOrder box.
/** buyOrder contract */ def DEX(buyer: Addrss, seller: Address, TID: Int, ergAmt: Long, tAmt: Long) { val cancelCondition: SigmaProp = { buyer } // verify buyer's sig (ProveDlog) val swapCondition = OUTPUTS.size > 0 && { // securing OUTPUTS access val buyerOut = OUTPUTS(0) // from [email protected] buyerOut.tokens.size > TID && { // securing tokens access val tid = buyerOut.tokens(TID) val regR4 = buyerOut.R4[Coll[Byte]] regR4.isDefined && { // securing R4 access val R4 = regR4.get tid._2 == tAmt && // from tAmt: TID R4 == SELF.id && // from R4 == bid.id buyerOut.propositionBytes == buyer.propBytes // from script == buyer } } } cancelCondition || swapCondition } 
A similar script for the sellOrder box can be obtained using the same translation rules. With the help of the tooling the code of contracts can be mechanically generated from the diagram specification.

Conclusions

Declarative programming models have already won the battle against imperative programming in many application domains like Big Data, Stream Processing, Deep Learning, Databases, etc. Ergo is pioneering the declarative model of dApp development as a better and safer alternative to the now popular imperative model of smart contracts.
The concept of FlowCard shifts the focus from writing ErgoScript contracts to the overall flow of values (hence the name), in such a way, that ErgoScript can always be generated from them. You will never need to look at the ErgoScript code once the tooling is in place.
Here are the possible next steps for future work:
  1. Storage format for FlowCard Spec and the corresponding EIP standardized file format (Json/XML/Protobuf). This will allow various tools (Diagram Editor, Runtime, dApps etc) to create and use *.flowcard files.
  2. FlowCard Viewer, which can generate the diagrams from *.flowcard files.
  3. FlowCard Runtime, which can run *.flowcard files, create and send transactions to Ergo network.
  4. FlowCard Designer Tool, which can simplify development of complex diagrams . This will make designing and validation of Ergo contracts a pleasant experience, more like drawing rather than coding. In addition, the correctness of the whole dApp scenario can be verified and controlled by the tooling.
submitted by eleanorcwhite to btc [link] [comments]

FlowCards: A Declarative Framework for Development of Ergo dApps

FlowCards: A Declarative Framework for Development of Ergo dApps
Introduction
ErgoScript is the smart contract language used by the Ergo blockchain. While it has concise syntax adopted from Scala/Kotlin, it still may seem confusing at first because conceptually ErgoScript is quite different compared to conventional languages which we all know and love. This is because Ergo is a UTXO based blockchain, whereas smart contracts are traditionally associated with account based systems like Ethereum. However, Ergo's transaction model has many advantages over the account based model and with the right approach it can even be significantly easier to develop Ergo contracts than to write and debug Solidity code.
Below we will cover the key aspects of the Ergo contract model which makes it different:
Paradigm
The account model of Ethereum is imperative. This means that the typical task of sending coins from Alice to Bob requires changing the balances in storage as a series of operations. Ergo's UTXO based programming model on the other hand is declarative. ErgoScript contracts specify conditions for a transaction to be accepted by the blockchain (not changes to be made in the storage state as result of the contract execution).
Scalability
In the account model of Ethereum both storage changes and validity checks are performed on-chain during code execution. In contrast, Ergo transactions are created off-chain and only validation checks are performed on-chain thus reducing the amount of operations performed by every node on the network. In addition, due to immutability of the transaction graph, various optimization strategies are possible to improve throughput of transactions per second in the network. Light verifying nodes are also possible thus further facilitating scalability and accessibility of the network.
Shared state
The account-based model is reliant on shared mutable state which is known to lead to complex semantics (and subtle million dollar bugs) in the context of concurrent/ distributed computation. Ergo's model is based on an immutable graph of transactions. This approach, inherited from Bitcoin, plays well with the concurrent and distributed nature of blockchains and facilitates light trustless clients.
Expressive Power
Ethereum advocated execution of a turing-complete language on the blockchain. It theoretically promised unlimited potential, however in practice severe limitations came to light from excessive blockchain bloat, subtle multi-million dollar bugs, gas costs which limit contract complexity, and other such problems. Ergo on the flip side extends UTXO to enable turing-completeness while limiting the complexity of the ErgoScript language itself. The same expressive power is achieved in a different and more semantically sound way.
With the all of the above points, it should be clear that there are a lot of benefits to the model Ergo is using. In the rest of this article I will introduce you to the concept of FlowCards - a dApp developer component which allows for designing complex Ergo contracts in a declarative and visual way.
From Imperative to Declarative
In the imperative programming model of Ethereum a transaction is a sequence of operations executed by the Ethereum VM. The following Solidity function implements a transfer of tokens from sender to receiver . The transaction starts when sender calls this function on an instance of a contract and ends when the function returns.
// Sends an amount of existing coins from any caller to an address function send(address receiver, uint amount) public { require(amount <= balances[msg.sender], "Insufficient balance."); balances[msg.sender] -= amount; balances[receiver] += amount; emit Sent(msg.sender, receiver, amount); } 
The function first checks the pre-conditions, then updates the storage (i.e. balances) and finally publishes the post-condition as the Sent event. The gas which is consumed by the transaction is sent to the miner as a reward for executing this transaction.
Unlike Ethereum, a transaction in Ergo is a data structure holding a list of input coins which it spends and a list of output coins which it creates preserving the total balances of ERGs and tokens (in which Ergo is similar to Bitcoin).
Turning back to the example above, since Ergo natively supports tokens, therefore for this specific example of sending tokens we don't need to write any code in ErgoScript. Instead we need to create the ‘send’ transaction shown in the following figure, which describes the same token transfer but declaratively.
https://preview.redd.it/id5kjdgn9tv41.png?width=1348&format=png&auto=webp&s=31b937d7ad0af4afe94f4d023e8c90c97c8aed2e
The picture visually describes the following steps, which the network user needs to perform:
  1. Select unspent sender's boxes, containing in total tB >= amount of tokens and B >= txFee + minErg ERGs.
  2. Create an output target box which is protected by the receiver public key with minErg ERGs and amount of T tokens.
  3. Create one fee output protected by the minerFee contract with txFee ERGs.
  4. Create one change output protected by the sender public key, containing B - minErg - txFee ERGs and tB - amount of T tokens.
  5. Create a new transaction, sign it using the sender's secret key and send to the Ergo network.
What is important to understand here is that all of these steps are preformed off-chain (for example using Appkit Transaction API) by the user's application. Ergo network nodes don't need to repeat this transaction creation process, they only need to validate the already formed transaction. ErgoScript contracts are stored in the inputs of the transaction and check spending conditions. The node executes the contracts on-chain when the transaction is validated. The transaction is valid if all of the conditions are satisfied.
Thus, in Ethereum when we “send amount from sender to recipient” we are literally editing balances and updating the storage with a concrete set of commands. This happens on-chain and thus a new transaction is also created on-chain as the result of this process.
In Ergo (as in Bitcoin) transactions are created off-chain and the network nodes only verify them. The effects of the transaction on the blockchain state is that input coins (or Boxes in Ergo's parlance) are removed and output boxes are added to the UTXO set.
In the example above we don't use an ErgoScript contract but instead assume a signature check is used as the spending pre-condition. However in more complex application scenarios we of course need to use ErgoScript which is what we are going to discuss next.
From Changing State to Checking Context
In the send function example we first checked the pre-condition (require(amount <= balances[msg.sender],...) ) and then changed the state (i.e. update balances balances[msg.sender] -= amount ). This is typical in Ethereum transactions. Before we change anything we need to check if it is valid to do so.
In Ergo, as we discussed previously, the state (i.e. UTXO set of boxes) is changed implicitly when a valid transaction is included in a block. Thus we only need to check the pre-conditions before the transaction can be added to the block. This is what ErgoScript contracts do.
It is not possible to “change the state” in ErgoScript because it is a language to check pre-conditions for spending coins. ErgoScript is a purely functional language without side effects that operates on immutable data values. This means all the inputs, outputs and other transaction parameters available in a script are immutable. This, among other things, makes ErgoScript a very simple language that is easy to learn and safe to use. Similar to Bitcoin, each input box contains a script, which should return the true value in order to 1) allow spending of the box (i.e. removing from the UTXO set) and 2) adding the transaction to the block.
If we are being pedantic, it is therefore incorrect (strictly speaking) to think of ErgoScript as the language of Ergo contracts, because it is the language of propositions (logical predicates, formulas, etc.) which protect boxes from “illegal” spending. Unlike Bitcoin, in Ergo the whole transaction and a part of the current blockchain context is available to every script. Therefore each script may check which outputs are created by the transaction, their ERG and token amounts (we will use this capability in our example DEX contracts), current block number etc.
In ErgoScript you define the conditions of whether changes (i.e. coin spending) are allowed to happen in a given context. This is in contrast to programming the changes imperatively in the code of a contract.
While Ergo's transaction model unlocks a whole range of applications like (DEX, DeFi Apps, LETS, etc), designing contracts as pre-conditions for coin spending (or guarding scripts) directly is not intuitive. In the next sections we will consider a useful graphical notation to design contracts declaratively using FlowCard Diagrams, which is a visual representation of executable components (FlowCards).
FlowCards aim to radically simplify dApp development on the Ergo platform by providing a high-level declarative language, execution runtime, storage format and a graphical notation.
We will start with a high level of diagrams and go down to FlowCard specification.
FlowCard Diagrams
The idea behind FlowCard diagrams is based on the following observations: 1) An Ergo box is immutable and can only be spent in the transaction which uses it as an input. 2) We therefore can draw a flow of boxes through transactions, so that boxes flowing in to the transaction are spent and those flowing out are created and added to the UTXO. 3) A transaction from this perspective is simply a transformer of old boxes to the new ones preserving the balances of ERGs and tokens involved.
The following figure shows the main elements of the Ergo transaction we've already seen previously (now under the name of FlowCard Diagram).
https://preview.redd.it/9kcxl11o9tv41.png?width=1304&format=png&auto=webp&s=378a7f50769292ca94de35ff597dc1a44af56d14
There is a strictly defined meaning (semantics) behind every element of the diagram, so that the diagram is a visual representation (or a view) of the underlying executable component (called FlowCard).
The FlowCard can be used as a reusable component of an Ergo dApp to create and initiate the transaction on the Ergo blockchain. We will discuss this in the coming sections.
Now let's look at the individual pieces of the FlowCard diagram one by one.
  1. Name and Parameters
Each flow card is given a name and a list of typed parameters. This is similar to a template with parameters. In the above figure we can see the Send flow card which has five parameters. The parameters are used in the specification.
  1. Contract Wallet
This is a key element of the flow card. Every box has a guarding script. Often it is the script that checks a signature against a public key. This script is trivial in ErgoScript and is defined like the def pk(pubkey: Address) = { pubkey } template where pubkey is a parameter of the type Address . In the figure, the script template is applied to the parameter pk(sender) and thus a concrete wallet contract is obtained. Therefore pk(sender) and pk(receiver) yield different scripts and represent different wallets on the diagram, even though they use the same template.
Contract Wallet contains a set of all UTXO boxes which have a given script derived from the given script template using flow card parameters. For example, in the figure, the template is pk and parameter pubkey is substituted with the `sender’ flow card parameter.
  1. Contract
Even though a contract is a property of a box, on the diagram we group the boxes by their contracts, therefore it looks like the boxes belong to the contracts, rather than the contracts belong to the boxes. In the example, we have three instantiated contracts pk(sender) , pk(receiver) and minerFee . Note, that pk(sender) is the instantiation of the pk template with the concrete parameter sender and minerFee is the instantiation of the pre-defined contract which protects the miner reward boxes.
  1. Box name
In the diagram we can give each box a name. Besides readability of the diagram, we also use the name as a synonym of a more complex indexed access to the box in the contract. For example, change is the name of the box, which can also be used in the ErgoScript conditions instead of OUTPUTS(2) . We also use box names to associate spending conditions with the boxes.
  1. Boxes in the wallet
In the diagram, we show boxes (darker rectangles) as belonging to the contract wallets (lighter rectangles). Each such box rectangle is connected with a grey transaction rectangle by either orange or green arrows or both. An output box (with an incoming green arrow) may include many lines of text where each line specifies a condition which should be checked as part of the transaction. The first line specifies the condition on the amount of ERG which should be placed in the box. Other lines may take one of the following forms:
  1. amount: TOKEN - the box should contain the given amount of the given TOKEN
  2. R == value - the box should contain the given value of the given register R
  3. boxName ? condition - the box named boxName should check condition in its script.
We discuss these conditions in the sections below.
  1. Amount of ERGs in the box
Each box should store a minimum amount of ERGs. This is checked when the creating transaction is validated. In the diagram the amount of ERGs is always shown as the first line (e.g. B: ERG or B - minErg - txFee ). The value type ascription B: ERG is optional and may be used for readability. When the value is given as a formula, then this formula should be respected by the transaction which creates the box.
It is important to understand that variables like amount and txFee are not named properties of the boxes. They are parameters of the whole diagram and representing some amounts. Or put it another way, they are shared parameters between transactions (e.g. Sell Order and Swap transactions from DEX example below share the tAmt parameter). So the same name is tied to the same value throughout the diagram (this is where the tooling would help a lot). However, when it comes to on-chain validation of those values, only explicit conditions which are marked with ? are transformed to ErgoScript. At the same time, all other conditions are ensured off-chain during transaction building (for example in an application using Appkit API) and transaction validation when it is added to the blockchain.
  1. Amount of T token
A box can store values of many tokens. The tokens on the diagram are named and a value variable may be associated with the token T using value: T expression. The value may be given by formula. If the formula is prefixed with a box name like boxName ? formula , then it is should also be checked in the guarding script of the boxName box. This additional specification is very convenient because 1) it allows to validate the visual design automatically, and 2) the conditions specified in the boxes of a diagram are enough to synthesize the necessary guarding scripts. (more about this below at “From Diagrams To ErgoScript Contracts”)
  1. Tx Inputs
Inputs are connected to the corresponding transaction by orange arrows. An input arrow may have a label of the following forms:
  1. [email protected] - optional name with an index i.e. [email protected] or u/2 . This is a property of the target endpoint of the arrow. The name is used in conditions of related boxes and the index is the position of the corresponding box in the INPUTS collection of the transaction.
  2. !action - is a property of the source of the arrow and gives a name for an alternative spending path of the box (we will see this in DEX example)
Because of alternative spending paths, a box may have many outgoing orange arrows, in which case they should be labeled with different actions.
  1. Transaction
A transaction spends input boxes and creates output boxes. The input boxes are given by the orange arrows and the labels are expected to put inputs at the right indexes in INPUTS collection. The output boxes are given by the green arrows. Each transaction should preserve a strict balance of ERG values (sum of inputs == sum of outputs) and for each token the sum of inputs >= the sum of outputs. The design diagram requires an explicit specification of the ERG and token values for all of the output boxes to avoid implicit errors and ensure better readability.
  1. Tx Outputs
Outputs are connected to the corresponding transaction by green arrows. An output arrow may have a label of the following [email protected] , where an optional name is accompanied with an index i.e. [email protected] or u/2 . This is a property of the source endpoint of the arrow. The name is used in conditions of the related boxes and the index is the position of the corresponding box in the OUTPUTS collection of the transaction.
Example: Decentralized Exchange (DEX)
Now let's use the above described notation to design a FlowCard for a DEX dApp. It is simple enough yet also illustrates all of the key features of FlowCard diagrams which we've introduced in the previous section.
The dApp scenario is shown in the figure below: There are three participants (buyer, seller and DEX) of the DEX dApp and five different transaction types, which are created by participants. The buyer wants to swap ergAmt of ERGs for tAmt of TID tokens (or vice versa, the seller wants to sell TID tokens for ERGs, who sends the order first doesn't matter). Both the buyer and the seller can cancel their orders any time. The DEX off-chain matching service can find matching orders and create the Swap transaction to complete the exchange.
The following diagram fully (and formally) specifies all of the five transactions that must be created off-chain by the DEX dApp. It also specifies all of the spending conditions that should be verified on-chain.

https://preview.redd.it/fnt5f4qp9tv41.png?width=1614&format=png&auto=webp&s=34f145f9a6d622454906857e645def2faba057bd
Let's discuss the FlowCard diagram and the logic of each transaction in details:
Buy Order Transaction
A buyer creates a Buy Order transaction. The transaction spends E amount of ERGs (which we will write E: ERG ) from one or more boxes in the pk(buyer) wallet. The transaction creates a bid box with ergAmt: ERG protected by the buyOrder script. The buyOrder script is synthesized from the specification (see below at “From Diagrams To ErgoScript Contracts”) either manually or automatically by a tool. Even though we don't need to define the buyOrder script explicitly during designing, at run time the bid box should contain the buyOrder script as the guarding proposition (which checks the box spending conditions), otherwise the conditions specified in the diagram will not be checked.
The change box is created to make the input and output sums of the transaction balanced. The transaction fee box is omitted because it can be added automatically by the tools. In practice, however, the designer can add the fee box explicitly to the a diagram. It covers the cases of more complex transactions (like Swap) where there are many ways to pay the transaction fee.
Cancel Buy, Cancel Sell Transactions
At any time, the buyer can cancel the order by sending CancelBuy transaction. The transaction should satisfy the guarding buyOrder contract which protects the bid box. As you can see on the diagram, both the Cancel and the Swap transactions can spend the bid box. When a box has spending alternatives (or spending paths) then each alternative is identified by a unique name prefixed with ! (!cancel and !swap for the bid box). Each alternative path has specific spending conditions. In our example, when the Cancel Buy transaction spends the bid box the ?buyer condition should be satisfied, which we read as “the signature for the buyer address should be presented in the transaction”. Therefore, only buyer can cancel the buy order. This “signature” condition is only required for the !cancel alternative spending path and not required for !swap .
Sell Order Transaction
The Sell Order transaction is similar to the BuyOrder in that it deals with tokens in addition to ERGs. The transaction spends E: ERG and T: TID tokens from seller's wallet (specified as pk(seller) contract). The two outputs are ask and change . The change is a standard box to balance transaction. The ask box keeps tAmt: TID tokens for the exchange and minErg: ERG - the minimum amount of ERGs required in every box.
Swap Transaction
This is a key transaction in the DEX dApp scenario. The transaction has several spending conditions on the input boxes and those conditions are included in the buyOrder and sellOrder scripts (which are verified when the transaction is added to the blockchain). However, on the diagram those conditions are not specified in the bid and ask boxes, they are instead defined in the output boxes of the transaction.
This is a convention for improved usability because most of the conditions relate to the properties of the output boxes. We could specify those properties in the bid box, but then we would have to use more complex expressions.
Let's consider the output created by the arrow labeled with [email protected] . This label tells us that the output is at the index 0 in the OUTPUTS collection of the transaction and that in the diagram we can refer to this box by the buyerOut name. Thus we can label both the box itself and the arrow to give the box a name.
The conditions shown in the buyerOut box have the form bid ? condition , which means they should be verified on-chain in order to spend the bid box. The conditions have the following meaning:
  • tAmt: TID requires the box to have tAmt amount of TID token
  • R4 == bid.id requires R4 register in the box to be equal to id of the bid box.
  • script == buyer requires the buyerOut box to have the script of the wallet where it is located on the diagram, i.e. pk(buyer)
Similar properties are added to the sellerOut box, which is specified to be at index 1 and the name is given to it using the label on the box itself, rather than on the arrow.
The Swap transaction spends two boxes bid and ask using the !swap spending path on both, however unlike !cancel the conditions on the path are not specified. This is where the bid ? and ask ? prefixes come into play. They are used so that the conditions listed in the buyerOut and sellerOut boxes are moved to the !swap spending path of the bid and ask boxes correspondingly.
If you look at the conditions of the output boxes, you will see that they exactly specify the swap of values between seller's and buyer's wallets. The buyer gets the necessary amount of TID token and seller gets the corresponding amount of ERGs. The Swap transaction is created when there are two matching boxes with buyOrder and sellOrder contracts.
From Diagrams To ErgoScript Contracts
What is interesting about FlowCard specifications is that we can use them to automatically generate the necessary ErgoTree scripts. With the appropriate tooling support this can be done automatically, but with the lack of thereof, it can be done manually. Thus, the FlowCard allows us to capture and visually represent all of the design choices and semantic details of an Ergo dApp.
What we are going to do next is to mechanically create the buyOrder contract from the information given in the DEX flow card.
Recall that each script is a proposition (boolean valued expression) which should evaluate to true to allow spending of the box. When we have many conditions to be met at the same time we can combine them in a logical formula using the AND binary operation, and if we have alternatives (not necessarily exclusive) we can put them into the OR operation.
The buyOrder box has the alternative spending paths !cancel and !swap . Thus the ErgoScript code should have OR operation with two arguments - one for each spending path.
/** buyOrder contract */ { val cancelCondition = {} val swapCondition = {} cancelCondition || swapCondition } 
The formula for the cancelCondition expression is given in the !cancel spending path of the buyOrder box. We can directly include it in the script.
/** buyOrder contract */ { val cancelCondition = { buyer } val swapCondition = {} cancelCondition || swapCondition } 
For the !swap spending path of the buyOrder box the conditions are specified in the buyerOut output box of the Swap transaction. If we simply include them in the swapCondition then we get a syntactically incorrect script.
/** buyOrder contract */ { val cancelCondition = { buyer } val swapCondition = { tAmt: TID && R4 == bid.id && @contract } cancelCondition || swapCondition } 
We can however translate the conditions from the diagram syntax to ErgoScript expressions using the following simple rules
  1. [email protected] ==> val buyerOut = OUTPUTS(0)
  2. tAmt: TID ==> tid._2 == tAmt where tid = buyerOut.tokens(TID)
  3. R4 == bid.id ==> R4 == SELF.id where R4 = buyerOut.R4[Coll[Byte]].get
  4. script == buyer ==> buyerOut.propositionBytes == buyer.propBytes
Note, in the diagram TID represents a token id, but ErgoScript doesn't have access to the tokens by the ids so we cannot write tokens.getByKey(TID) . For this reason, when the diagram is translated into ErgoScript, TID becomes a named constant of the index in tokens collection of the box. The concrete value of the constant is assigned when the BuyOrder transaction with the buyOrder box is created. The correspondence and consistency between the actual tokenId, the TID constant and the actual tokens of the buyerOut box is ensured by the off-chain application code, which is completely possible since all of the transactions are created by the application using FlowCard as a guiding specification. This may sound too complicated, but this is part of the translation from diagram specification to actual executable application code, most of which can be automated.
After the transformation we can obtain a correct script which checks all the required preconditions for spending the buyOrder box.
/** buyOrder contract */ def DEX(buyer: Addrss, seller: Address, TID: Int, ergAmt: Long, tAmt: Long) { val cancelCondition: SigmaProp = { buyer } // verify buyer's sig (ProveDlog) val swapCondition = OUTPUTS.size > 0 && { // securing OUTPUTS access val buyerOut = OUTPUTS(0) // from [email protected] buyerOut.tokens.size > TID && { // securing tokens access val tid = buyerOut.tokens(TID) val regR4 = buyerOut.R4[Coll[Byte]] regR4.isDefined && { // securing R4 access val R4 = regR4.get tid._2 == tAmt && // from tAmt: TID R4 == SELF.id && // from R4 == bid.id buyerOut.propositionBytes == buyer.propBytes // from script == buyer } } } cancelCondition || swapCondition } 
A similar script for the sellOrder box can be obtained using the same translation rules. With the help of the tooling the code of contracts can be mechanically generated from the diagram specification.
Conclusions
Declarative programming models have already won the battle against imperative programming in many application domains like Big Data, Stream Processing, Deep Learning, Databases, etc. Ergo is pioneering the declarative model of dApp development as a better and safer alternative to the now popular imperative model of smart contracts.
The concept of FlowCard shifts the focus from writing ErgoScript contracts to the overall flow of values (hence the name), in such a way, that ErgoScript can always be generated from them. You will never need to look at the ErgoScript code once the tooling is in place.
Here are the possible next steps for future work:
  1. Storage format for FlowCard Spec and the corresponding EIP standardized file format (Json/XML/Protobuf). This will allow various tools (Diagram Editor, Runtime, dApps etc) to create and use *.flowcard files.
  2. FlowCard Viewer, which can generate the diagrams from *.flowcard files.
  3. FlowCard Runtime, which can run *.flowcard files, create and send transactions to Ergo network.
  4. FlowCard Designer Tool, which can simplify development of complex diagrams . This will make designing and validation of Ergo contracts a pleasant experience, more like drawing rather than coding. In addition, the correctness of the whole dApp scenario can be verified and controlled by the tooling.
submitted by Guilty_Pea to CryptoCurrencies [link] [comments]

Groestlcoin 6th Anniversary Release

Introduction

Dear Groestlers, it goes without saying that 2020 has been a difficult time for millions of people worldwide. The groestlcoin team would like to take this opportunity to wish everyone our best to everyone coping with the direct and indirect effects of COVID-19. Let it bring out the best in us all and show that collectively, we can conquer anything.
The centralised banks and our national governments are facing unprecedented times with interest rates worldwide dropping to record lows in places. Rest assured that this can only strengthen the fundamentals of all decentralised cryptocurrencies and the vision that was seeded with Satoshi's Bitcoin whitepaper over 10 years ago. Despite everything that has been thrown at us this year, the show must go on and the team will still progress and advance to continue the momentum that we have developed over the past 6 years.
In addition to this, we'd like to remind you all that this is Groestlcoin's 6th Birthday release! In terms of price there have been some crazy highs and lows over the years (with highs of around $2.60 and lows of $0.000077!), but in terms of value– Groestlcoin just keeps getting more valuable! In these uncertain times, one thing remains clear – Groestlcoin will keep going and keep innovating regardless. On with what has been worked on and completed over the past few months.

UPDATED - Groestlcoin Core 2.18.2

This is a major release of Groestlcoin Core with many protocol level improvements and code optimizations, featuring the technical equivalent of Bitcoin v0.18.2 but with Groestlcoin-specific patches. On a general level, most of what is new is a new 'Groestlcoin-wallet' tool which is now distributed alongside Groestlcoin Core's other executables.
NOTE: The 'Account' API has been removed from this version which was typically used in some tip bots. Please ensure you check the release notes from 2.17.2 for details on replacing this functionality.

How to Upgrade?

Windows
If you are running an older version, shut it down. Wait until it has completely shut down (which might take a few minutes for older versions), then run the installer.
OSX
If you are running an older version, shut it down. Wait until it has completely shut down (which might take a few minutes for older versions), run the dmg and drag Groestlcoin Core to Applications.
Ubuntu
http://groestlcoin.org/forum/index.php?topic=441.0

Other Linux

http://groestlcoin.org/forum/index.php?topic=97.0

Download

Download the Windows Installer (64 bit) here
Download the Windows Installer (32 bit) here
Download the Windows binaries (64 bit) here
Download the Windows binaries (32 bit) here
Download the OSX Installer here
Download the OSX binaries here
Download the Linux binaries (64 bit) here
Download the Linux binaries (32 bit) here
Download the ARM Linux binaries (64 bit) here
Download the ARM Linux binaries (32 bit) here

Source

ALL NEW - Groestlcoin Moonshine iOS/Android Wallet

Built with React Native, Moonshine utilizes Electrum-GRS's JSON-RPC methods to interact with the Groestlcoin network.
GRS Moonshine's intended use is as a hot wallet. Meaning, your keys are only as safe as the device you install this wallet on. As with any hot wallet, please ensure that you keep only a small, responsible amount of Groestlcoin on it at any given time.

Features

Download

iOS
Android

Source

ALL NEW! – HODL GRS Android Wallet

HODL GRS connects directly to the Groestlcoin network using SPV mode and doesn't rely on servers that can be hacked or disabled.
HODL GRS utilizes AES hardware encryption, app sandboxing, and the latest security features to protect users from malware, browser security holes, and even physical theft. Private keys are stored only in the secure enclave of the user's phone, inaccessible to anyone other than the user.
Simplicity and ease-of-use is the core design principle of HODL GRS. A simple recovery phrase (which we call a Backup Recovery Key) is all that is needed to restore the user's wallet if they ever lose or replace their device. HODL GRS is deterministic, which means the user's balance and transaction history can be recovered just from the backup recovery key.

Features

Download

Main Release (Main Net)
Testnet Release

Source

ALL NEW! – GroestlcoinSeed Savior

Groestlcoin Seed Savior is a tool for recovering BIP39 seed phrases.
This tool is meant to help users with recovering a slightly incorrect Groestlcoin mnemonic phrase (AKA backup or seed). You can enter an existing BIP39 mnemonic and get derived addresses in various formats.
To find out if one of the suggested addresses is the right one, you can click on the suggested address to check the address' transaction history on a block explorer.

Features

Live Version (Not Recommended)

https://www.groestlcoin.org/recovery/

Download

https://github.com/Groestlcoin/mnemonic-recovery/archive/master.zip

Source

ALL NEW! – Vanity Search Vanity Address Generator

NOTE: NVidia GPU or any CPU only. AMD graphics cards will not work with this address generator.
VanitySearch is a command-line Segwit-capable vanity Groestlcoin address generator. Add unique flair when you tell people to send Groestlcoin. Alternatively, VanitySearch can be used to generate random addresses offline.
If you're tired of the random, cryptic addresses generated by regular groestlcoin clients, then VanitySearch is the right choice for you to create a more personalized address.
VanitySearch is a groestlcoin address prefix finder. If you want to generate safe private keys, use the -s option to enter your passphrase which will be used for generating a base key as for BIP38 standard (VanitySearch.exe -s "My PassPhrase" FXPref). You can also use VanitySearch.exe -ps "My PassPhrase" which will add a crypto secure seed to your passphrase.
VanitySearch may not compute a good grid size for your GPU, so try different values using -g option in order to get the best performances. If you want to use GPUs and CPUs together, you may have best performances by keeping one CPU core for handling GPU(s)/CPU exchanges (use -t option to set the number of CPU threads).

Features

Usage

https://github.com/Groestlcoin/VanitySearch#usage

Download

Source

ALL NEW! – Groestlcoin EasyVanity 2020

Groestlcoin EasyVanity 2020 is a windows app built from the ground-up and makes it easier than ever before to create your very own bespoke bech32 address(es) when whilst not connected to the internet.
If you're tired of the random, cryptic bech32 addresses generated by regular Groestlcoin clients, then Groestlcoin EasyVanity2020 is the right choice for you to create a more personalised bech32 address. This 2020 version uses the new VanitySearch to generate not only legacy addresses (F prefix) but also Bech32 addresses (grs1 prefix).

Features

Download

Source

Remastered! – Groestlcoin WPF Desktop Wallet (v2.19.0.18)

Groestlcoin WPF is an alternative full node client with optional lightweight 'thin-client' mode based on WPF. Windows Presentation Foundation (WPF) is one of Microsoft's latest approaches to a GUI framework, used with the .NET framework. Its main advantages over the original Groestlcoin client include support for exporting blockchain.dat and including a lite wallet mode.
This wallet was previously deprecated but has been brought back to life with modern standards.

Features

Remastered Improvements

Download

Source

ALL NEW! – BIP39 Key Tool

Groestlcoin BIP39 Key Tool is a GUI interface for generating Groestlcoin public and private keys. It is a standalone tool which can be used offline.

Features

Download

Windows
Linux :
 pip3 install -r requirements.txt python3 bip39\_gui.py 

Source

ALL NEW! – Electrum Personal Server

Groestlcoin Electrum Personal Server aims to make using Electrum Groestlcoin wallet more secure and more private. It makes it easy to connect your Electrum-GRS wallet to your own full node.
It is an implementation of the Electrum-grs server protocol which fulfils the specific need of using the Electrum-grs wallet backed by a full node, but without the heavyweight server backend, for a single user. It allows the user to benefit from all Groestlcoin Core's resource-saving features like pruning, blocks only and disabled txindex. All Electrum-GRS's feature-richness like hardware wallet integration, multi-signature wallets, offline signing, seed recovery phrases, coin control and so on can still be used, but connected only to the user's own full node.
Full node wallets are important in Groestlcoin because they are a big part of what makes the system be trust-less. No longer do people have to trust a financial institution like a bank or PayPal, they can run software on their own computers. If Groestlcoin is digital gold, then a full node wallet is your own personal goldsmith who checks for you that received payments are genuine.
Full node wallets are also important for privacy. Using Electrum-GRS under default configuration requires it to send (hashes of) all your Groestlcoin addresses to some server. That server can then easily spy on your transactions. Full node wallets like Groestlcoin Electrum Personal Server would download the entire blockchain and scan it for the user's own addresses, and therefore don't reveal to anyone else which Groestlcoin addresses they are interested in.
Groestlcoin Electrum Personal Server can also broadcast transactions through Tor which improves privacy by resisting traffic analysis for broadcasted transactions which can link the IP address of the user to the transaction. If enabled this would happen transparently whenever the user simply clicks "Send" on a transaction in Electrum-grs wallet.
Note: Currently Groestlcoin Electrum Personal Server can only accept one connection at a time.

Features

Download

Windows
Linux / OSX (Instructions)

Source

UPDATED – Android Wallet 7.38.1 - Main Net + Test Net

The app allows you to send and receive Groestlcoin on your device using QR codes and URI links.
When using this app, please back up your wallet and email them to yourself! This will save your wallet in a password protected file. Then your coins can be retrieved even if you lose your phone.

Changes

Download

Main Net
Main Net (FDroid)
Test Net

Source

UPDATED – Groestlcoin Sentinel 3.5.06 (Android)

Groestlcoin Sentinel is a great solution for anyone who wants the convenience and utility of a hot wallet for receiving payments directly into their cold storage (or hardware wallets).
Sentinel accepts XPUB's, YPUB'S, ZPUB's and individual Groestlcoin address. Once added you will be able to view balances, view transactions, and (in the case of XPUB's, YPUB's and ZPUB's) deterministically generate addresses for that wallet.
Groestlcoin Sentinel is a fork of Groestlcoin Samourai Wallet with all spending and transaction building code removed.

Changes

Download

Source

UPDATED – P2Pool Test Net

Changes

Download

Pre-Hosted Testnet P2Pool is available via http://testp2pool.groestlcoin.org:21330/static/

Source

submitted by Yokomoko_Saleen to groestlcoin [link] [comments]

Darwinia development team Itering wins funding from Web3 Foundation

Darwinia development team Itering wins funding from Web3 Foundation

https://preview.redd.it/9wjacfdet2g41.jpg?width=750&format=pjpg&auto=webp&s=f2344aa2383ac3d6f5fe54c21cbdd921964e5040
Web3 Foundation announced a new list of W3F Grants for its funding plan. The project Scale submitted by the Darwinia development team Itering(www.itering.io), who has received the investment support of Web3 Foundation and has become the officially recognized project of the Web3 ecosystem and Polkadot.

What is Scale

Scale is a substrate JSON-RPC API client and libraries implemented in ruby language for general use. It contains the implementation of low-level data formats, various substrate types and also supports metadata. This work is the prerequisite of our subsequent series of projects. We hope to easily access Polkadot and Substrate through our familiar language ruby, such that the applications based on Polkadot / Substrate can be developed at a fast pace. We plan to develop some substrate-based web games. The back end of these applications is prepared to be developed in ruby language, and then interact with nodes or synchronize data through RPC.

About Itering

Itering (www.itering.io) is a blockchain technology company founded in Singapore in 2018. Most of people in this company are senior blockchain developers and experts in the blockchain core technology and participate in the development the open source projects of Bitcoin, Ethereum, NEO, etc. The blockchain core development is the most important part of current development, especially the cross chain technology.
The Darwinia Network is also developed by Itering and focus on the assets exchange and help blockchain applications cross-chain. The first integration part of Darwinia Network facing on gaming is Evolution Land, which is also developed by Itering in 2018 to 2019, and have Ethereum Land and Tron Land. The goal of Itering is to promote the massive adoption of blockchain and iterate to a trust-free future. The Scale is the first big step in blockchain games and Evolution Land, and also let the Darwinia Network move much forwards to the goal.

Following Us

ITERING: https://www.itering.io/ DARWINIA: https://darwinia.network/ Twitter: https://twitter.com/DarwiniaNetwork Telegram: https://t.me/DarwiniaNetwork
submitted by sixige to dot [link] [comments]

☘️ ReX: get all the data you want from these lovely APIs into a spreadsheet

ReX is a tool that makes APIs accessible for everyone.
Add your own public or private request queries and explore/learn about these lovely API endpoints.There is a list of public and private commands already available in the tool as well:
Rex is ready to fetch from: Binance, Bitfinex, BitMEX, Bittrex, Bybit, Currency.com , Deribit, Kraken, CoinMarketCap, CryptoCompare
Get it on: https://sites.google.com/site/moosyresearch/projects/cryptos/doc/rex

Index: API apis json request public private sha google apps script gas spreadsheet excel xls xlss bitcoin ethereum btc eth exchange
submitted by moosylog to Cointrexer [link] [comments]

Loom Network Was the 8th Most Developed ERC-20 Dapp in December! - Santiment Community Insights

https://twitter.com/santimentfeed/status/1212047962827829248
As many of you may know by now, our team at Santiment (the most comprehensive cryptocurrency data analytics platform available) analyzes which projects have been developing most rapidly, based on submission rates that we track using each projects' Github metrics (explained in this article).
Some of the more recent milestones from the Loom team include:
For those of you who don't know about Santiment, we track metrics and insights for all things crypto, and pay particular focus toward ERC-20 Dapps. This project's development activity and improvements have been consistently among the highest among them. Check out the full month's countdown here.
Please feel free to subscribe to Santiment, and Pro subscriptions are getting a major overhaul in added features and more quality templates, such as NVT and DAA Divergence up-to-the-day market analysis to find local tops and bottoms! Our premium users are reporting significantly greater returns that more than outweigh the affordable packages we offer. For more insights like this if these types of analyses interest you. We'd also recommend our Twitter page as a source to be consistently updated on all sorts of insights we release on a regular basis. Thank you!
submitted by BrianAtSantiment to loomnetwork [link] [comments]

[For Hire] Almost 30 Years Experience - Web / Mobile / Desktop / Database Development by Expert Full Stack Freelancer REMOTE ONLY

I am a coder; A digital problem solver. I am a Full Stack Freelance Developer with almost 30 years of experience coding in various languages for a multitude of platforms, and I want to help you make technology and software work better.

Portfolio: https://john.barba4.com

Skills: PHP • Laravel • Vue.js • Javascript • XML • JSON • .NET • Vuex • Linux • CentOS • Ubuntu • Research • NativeScript • SMTP • jQuery • Node • Nodejs • NET • C# • Bootstrap • Web Technologies • Web Development • Mobile • Android • Visual Basic • Win32 API • Windows 10 • Windows 8 • Windows 7 • Windows Vista • Windows Server • Active Directory • DNS • Exchange Server • SQL • MySQL • Wordpress • HTML 5 • CSS3 • HTML • CSS • And more ...
Experience: 28+ Years
Project Availability: Contact me
Standard Rate: $90 per hour
Project Types: Hourly or fixed, Remote Only
Payment Options: PayPal (USD), Bitcoin (BTC), Bitcoin Cash (BCH), Ethereum (ETH), EOS (EOS), and most other Crypto Currencies
Deposits: A deposit may be required for new clients
Service Location: Worldwide
Physical Location: San Juan, Puerto Rico
Time zone: AST - Atlantic Standard Time (GMT/UTC - 4h)
Availability: 7am to 8pm AST, Monday through Friday
Human Languages: English (Native Speaker), Spanish (Advanced Reader, Intermediate Speaker)
Communication Channels (in order of preference): E-mail, WhatsApp, SMS Text Messaging, Skype. PLEASE NOTE: Written notes are the key to good communication and great results. As such, I ask that all voice communications be backed up by written channels summarizing discussion points and work requests.

OFFERS

TIPS

LINKS

submitted by jbarba4 to jobbit [link] [comments]

[Sunday, 15. December]

World News

Greta Thunberg tells cheering crowd 'we will make sure we put world leaders against the wall' if they do not tackle global warming | 'The adults are behaving as if there is no tomorrow but there is a tomorrow, it is the tomorrow where our young people will live & we have to fight for that tomorrow."
Comments | Link
Justin Trudeau moves forward with ban on LGBT+ conversion therapy across Canada
Comments | Link
Greta Thunberg apologises after saying politicians should be ‘put against the wall’. 'That’s what happens when you improvise speeches in a second language’ the 16-year-old said following criticism
Comments | Link

All news, US and international.

Mom whose baby was ripped from her arms by officers in NYC to get $625K settlement
Comments | Link
Cryptocurrency tycoon died leaving $145M in limbo
Comments | Link
Colorado woman gets revenge on porch pirates by stuffing decoy boxes with garbage
Comments | Link

Science

Researchers developed a self-cleaning surface that repel all forms of bacteria, including antibiotic-resistant superbugs, inspired by the water-repellent lotus leaf. A new study found it successfully repelled MRSA and Pseudomonas. It can be shrink-wrapped onto surfaces and used for food packaging.
Comments | Link
Sound waves can be used to separate microplastics from laundry wastewater, reports new study. Oceans are currently under threat from "microplastic", which may be shed by synthetic fabrics as they're being washed. The new setup was found to capture 95% of PET fibers, and 99% of Nylon 6 fibers.
Comments | Link
Research on UMass Amherst course shows resilience can be taught. The ability to persist through challenges and recover from adversity - is no longer considered a character trait by researchers but a practiced interaction between person and environment
Comments | Link

/Technology

House panel asks Apple, Google if app makers must reveal foreign ties - It's concerned TikTok, Grindr and other apps might pose security risks.
Comments | Link
Apple accused of monitoring employee text messages in lawsuit against ex-chip exec
Comments | Link
This alleged Bitcoin scam looked a lot like a pyramid scheme. Five men face federal charges of bilking investors of $722 million.
Comments | Link

Sadly, this is not the Onion.

Free agent Antonio Brown says it's time to ghost white women
Comments | Link
Bathroom sign says employees must have 'smell check' to ensure 'not sitting on phone' for too long
Comments | Link
Louisiana sues California over alligator ban
Comments | Link

Ask Reddit...

[serious] They say everyone we meet is fighting a battle we know nothing about... so we should always be kind. What battle are you fighting?
Comments
What happened to that person that took your virginity? Where are they in life?
Comments
What turns you on almost instantly?
Comments

Sysadmin

A Dropbox account gave me stomach ulcers
Comments
Update on recent NGINX situation
Comments
Just remember this in your emergencies Guys & Gals.
Comments

Microsoft SQL Server

JSON strings as stored procedure parameters
Comments
Sql Server Stored Procedure datatype that is like a list
Comments

PowerShell

Moving files based on name
Comments
Using PowerShell Core 6 and 7 in the Windows PowerShell ISE
Comments | Link
Starting from the bottom
Comments

Functional 3D Printing

I printed some two-color QR coasters so my guests can connect to the WiFi without asking me for the password
Comments | Link
Magnetic print
Comments | Link
Couldn't find a magnetic cleaner for my fishbowl so made a custom one with the exact curvature required and in-print magnets.
Comments | Link

Data Is Beautiful

Swear words in Tarantino movies [OC]
Comments | Link
I dieted for 80 days and recorded my weight and calories eaten per day [OC]
Comments | Link
[OC] Compare your favorite music artists head-to-head here in this interactive visualization powered by Spotify API (demo link in comment)
Comments | Link

Today I Learned (TIL)

TIL forcing left-handed children to write with their right hands is not in any way innocuous or helpful- it is actually harmful to their developing brains and can result in dyslexia, stuttering and other learning or speech disorders.
Comments | Link
TIL actor Robert Pattinson dealt with an obsessed fan who had been camping outside his apartment by taking her out on a dinner date. "I just complained about everything in my life and she never came back."
Comments | Link
TIL that 95% of the world's food needs are provided by just 30 species of plants. At least 12,650 species names have been compiled as edible.
Comments | Link

So many books, so little time

The employees at iconic NYC bookstore McNally Jackson have voted to unionize.
Comments | Link
I’m a sucker for long books.
Comments
What are some examples of high quality prose?
Comments

OldSchoolCool: History's cool kids, looking fantastic

Winona Ryder and Christina Ricci in 1989.
Comments | Link
My great great grandma, in the foothills if the Appalachian mountains around 1915
Comments | Link
Conan O'Brien and Bob Odenkirk in the SNL writer's room, 1988.
Comments | Link

aviation

Su-34 bombers over MIBC | Moscow, Russia | Photo: Vladimir Astapkovich [900x603]
Comments | Link
The Gimli Glider
Comments | Link
America’s ass
Comments | Link

Reddit Pics

My wedding dress didn’t arrive in time so I wore my mom’s 1960s wedding dress and it was perfect for our backyard ceremony.
Comments | Link
Mural I painted in Memphis Tennessee
Comments | Link
I made a penny floor that worked out cheaper than a real floor !
Comments | Link

.gifs - funny, animated gifs for your viewing pleasure

Living The Good Life!
Comments | Link
A band of monkeys accepting a stray dog into their group and giving him a quality grooming
Comments | Link
Pot Painting
Comments | Link

A subreddit for cute and cuddly pictures

My little helpers.
Comments | Link
I felt bad for my cat not being able to see out to our front yard, so together we cut him a peep hole in the frosting.
Comments | Link
Kisses before you go!
Comments | Link
submitted by DangerDylan to DangerDylanTLDR [link] [comments]

It's finally here! Tautulli v2 [beta] (formerly PlexPy v2)

It's finally here! Tautulli v2 [beta] (formerly PlexPy v2).

The long awaited for PlexPy v2 is finally here with a new name Tautulli! Also check us out on the new Plex Labs!
I'm looking for some brave people to help me test some new feature before I fully release them. It's a very big update so I want to make sure everything is working.
Warning: This may mess up your PlexPy install and/or your database. You have been warned. Only join the beta if you are serious about testing and reporting bugs, otherwise I strongly recommend you wait until the final release.

Changelog

v2.0.0-beta (2017-12-18)

v2.0.1-beta (2017-12-19)

v2.0.2-beta (2017-12-24)

v2.0.3-beta (2017-12-25)

v2.0.4-beta (2017-12-29)

v2.0.5-beta (2017-12-31)

v2.0.6-beta (2017-12-31)

v2.0.7-beta (2018-01-01)

v2.0.8-beta (2018-01-03)

v2.0.9-beta (2018-01-03)

v2.0.10-beta (2018-01-04)

v2.0.11-beta (2018-01-05)

v2.0.12-beta (2018-01-07)

v2.0.13-beta (2018-01-13)

v2.0.14-beta (2018-01-20)

v2.0.15-beta (2018-01-27)

v2.0.16-beta (2018-01-30)

v2.0.17-beta (2018-02-03)

v2.0.18-beta (2018-02-12)

v2.0.19-beta (2018-02-16)

v2.0.20-beta (2018-02-24)

v2.0.21-beta (2018-03-04)

v2.0.22-beta (2018-03-09)

"I'm interested! Where do I sign up?"

Assuming you already have PlexPy installed using git, all you need to do is follow these steps:
  1. Backup your database! Go to the PlexPy Settings > General tab > Backup Database. You will need to restore this if something messes up. I'm not helping you if you mess up your database and you didn't create a backup.
  2. Shut down PlexPy by going to Settings > Shutdown.
  3. Using your shell/command line, run the following from the PlexPy folder:
    git fetch git checkout beta 
  4. Start Tautulli as normal.
  5. Post below if you find any bugs (include logs). Please don't post on GitHub issues or the Plex forum thread with bugs/issues from the beta test. If you do, I will laugh at you and delete your post.
    • Please read the issues guidelines before report any problems, and refer to the FAQ for common issues.
    • New features can be submitted on FeatHub (use the search to see if it has already been requested). Please read the feature request guidelines before requesting new features.
    • Join the Discord Server chat for faster help and general chit chat. (Note: the Gitter chat is no longer being used.)
If you want to revert back to the version of PlexPy before beta testing:
Warning: You will not be able to use your v2 database with v1!
  1. Shut down Tautulli by going to Settings > Shutdown.
  2. Restore your backed up plexpy.db file (it can be found in the backup folder).
  3. Using your shell/command line, run the following from the PlexPy folder:
    git checkout master 
  4. Start PlexPy as normal.
Buy me a coffee if you want to support the project! - PayPal | Bitcoin: 3FdfJAyNWU15Sf11U9FTgPHuP1hPz32eEN

Answers to your questions:

  • Why did you call it Tautulli?
    • Because it sounds cool and means "to watch or monitor" in Inuktitut.
  • I don't like the new name!
    • That's too bad. Also, that is not a question.
  • When will v2 be out of beta?
    • When I feel like there are no more major bugs with it. SoonTM.
  • Is there an iOS app?
    • No, there isn't. It costs money to be an iOS developer.
submitted by SwiftPanda16 to PleX [link] [comments]

Developing a JSON:API Query Builder - YouTube Bitcoin JSON-RPC Tutorial 5 - Your First Calls Bitcoin JSON-RPC Tutorial 1 Rest Service To Handle Json List Input As ArrayList Bitcoin JSON-RPC Tutorial 5 - Your First Calls

Accounts explained • API calls list • API reference (JSON-RPC) • Block chain download • Dump format • getblocktemplate • List of address prefixes • Protocol documentation • Script • Technical background of version 1 Bitcoin addresses • Testnet • Transaction Malleability • Wallet import format In this code in Python, I used an API called CoinDesk to get the Bitcoin price as JSON. I'm trying to follow the best practices in coding, so, I've used logging and I'm using a code formatter in my editor. Kindly, any enhancements on this code will be appreciated. # Project Idea: Bitcoin price program using CoinDesk API with Python. getrawchangeaddress ( "address_type" ) Returns a new Bitcoin address for receiving change. This is for use with raw transactions, not normal use. getrawmempool ( verbose ) Returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object. Find the parameters you need to create your own trading software using the Bitstamp API. Control your account remotely through our application programming interface. Bitstamp is a global cryptocurrency exchange, supporting Bitcoin, Ethereum, XRP, Bitcoin Cash and Litecoin trading. $ ./bitcoind -daemon bitcoin server starting $ ./bitcoin-cli -rpcwait help # shows the help text A list of RPC calls will be shown. $ ./bitcoin-cli getbalance 2000.00000 If you are learning the API, it is a very good idea to use the test network (run bitcoind -testnet and bitcoin-cli -testnet). JSON-RPC

[index] [29953] [31229] [3946] [28072] [8979] [15433] [25685] [1566] [22179] [25425]

Developing a JSON:API Query Builder - YouTube

Confused about APIs and JSON? Looking to run an arbitrage business or build a data intensive site? ... Welcome to WBN's Bitcoin 101 Blackboard Series -- a full beginner to expert course in bitcoin ... REST API concepts and examples - Duration: 8:53. WebConcepts 4,749,679 ... Imperial College London Recommended for you. 18:39. Bitcoin JSON-RPC Tutorial 4 - Command Line Interface - Duration: 5:14. Top 100 Free Stock Videos 4K Rview and Download in Pixabay 12/2018 - Duration: 41:56. Free Stock Video Recommended for you Bitcoin JSON-RPC Tutorial 1 - Duration: 1:57. m1xolyd1an 23,577 views. ... SoapUI Open Source API request response chaining with JSON - Duration: 25:45. Automation Step by Step ... Bitcoin JSON-RPC Tutorial 5 - Your First Calls ... REST API concepts and examples - Duration: 8:53. WebConcepts 4,754,909 views. 8:53. Top Five Useful Knots for camping, ...

Flag Counter