diff --git a/README.md b/README.md index 7b283314d90b826d5c0f637e002b575a5b6bee92..4484c5162bfb09c7cb50ca945e7d5dd430539242 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ producer-name = initu # Load the block producer plugin, so we can produce blocks plugin = eos::producer_plugin # As well as API and HTTP plugins +plugin = eos::wallet_api_plugin plugin = eos::chain_api_plugin plugin = eos::http_plugin ``` @@ -284,36 +285,25 @@ cd ~/eos/build/programs/eosd/ ### Run eos-walletd and importing account key -Before running the API commands you need to start EOS wallet process and import private key of an account you will be authorizing the transactions under. +Before running API commands you need to import the private key of an account you will be authorizing the transactions under into the EOS wallet. -```commandline -cd ~/eos/build/programs/ -./eos-walletd -``` - -You need to make sure that the port number in `cd ~/eos/build/programs/eos-walled/data-dir/config.ini` does not conflict with the port number `eosd` is running on (check in `~/eos/build/programs/eosd/data-dir/config.ini`). Change the line in `cd ~/eos/build/programs/eos-walled/data-dir/config.ini` to: - -```commandline -http-server-endpoint = 127.0.0.1:8887 -``` - -Leave `eos-walletd` running. +As you've previously added `plugin = eos::wallet_api_plugin` into `config.ini`, EOS wallet will be running as a part of `eosd` process. -For testing purposes we will be logging in the wallet with a pre-created account `inita` from the `genesis.json` file. +For testing purposes you can use a pre-created account `inita` from the `genesis.json` file. To login you need to run a command importing an active (not owner!) private key from `inita` account (you can find it in `~/eos/build/programs/eosd/data-dir/config.ini`) to the wallet. ```commandline cd ~/eos/build/programs/eosc/ -./eosc --wallet-port 8887 wallet create # You get a password that you need to save to be able to lock/unlock the wallet -./eosc --wallet-port 8887 wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 +./eosc wallet create # Outputs a password that you need to save to be able to lock/unlock the wallet +./eosc wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 ``` -Now we can issue API commands under `inita` authority. +Now you can issue API commands under `inita` authority. ### Create accounts for your smart contracts -First, generate public/private key pairs for the `owner_key` and `active_key`. We will need them to create an account: +First, generate public/private key pairs for the `owner_key` and `active_key`. You will need them to create an account: ```commandline cd ~/eos/build/programs/eosc/ @@ -333,7 +323,7 @@ Save the values for future reference. Run `create` command where `PUBLIC_KEY_1` and `PUBLIC_KEY_2` are the values generated by the `create key` command: ```commandline -./eosc --wallet-port 8887 create account inita currency PUBLIC_KEY_1 PUBLIC_KEY_2 +./eosc create account inita currency PUBLIC_KEY_1 PUBLIC_KEY_2 ``` You should get a json response back with a transaction ID confirming it was executed successfully. @@ -358,7 +348,7 @@ You should get a response similar to this: ### Upload sample contract -Before uploading a contract, we can verify that there is no current contract: +Before uploading a contract, you can verify that there is no current contract: ```commandline ./eosc get code currency @@ -368,19 +358,19 @@ code hash: 0000000000000000000000000000000000000000000000000000000000000000 With an account for a contract created, you can upload a sample contract: ```commandline -./eosc --wallet-port 8887 set contract currency ../../../contracts/currency/currency.wast ../../../contracts/currency/currency.abi +./eosc set contract currency ../../../contracts/currency/currency.wast ../../../contracts/currency/currency.abi ``` As a response you should get a json with a `transaction_id` field. Your contract was successfully uploaded! -We can also verify that the code has been set: +You can also verify that the code has been set: ```commandline ./eosc get code currency code hash: 9b9db1a7940503a88535517049e64467a6e8f4e9e03af15e9968ec89dd794975 ``` -Next we can verify that the currency contract has the proper initial balance: +Next you can verify that the currency contract has the proper initial balance: ```commandline ./eosc get table currency currency account @@ -396,7 +386,7 @@ Next we can verify that the currency contract has the proper initial balance: ### Push a message to a sample contract -To send a message to a contract we need to create a new user account who will be sending the message. +To send a message to a contract you need to create a new user account who will be sending the message. Firstly, generate the keys for the account: @@ -409,13 +399,13 @@ cd ~/eos/build/programs/eosc/ And then create the `tester` account: ```commandline -./eosc --wallet-port 8887 create account inita tester PUBLIC_USER_KEY_1 PUBLIC_USER_KEY_2 +./eosc create account inita tester PUBLIC_USER_KEY_1 PUBLIC_USER_KEY_2 ``` -After this we can send a message to the contract: +After this you can send a message to the contract: ```commandline -./eosc --wallet-port 8887 push message currency transfer '{"from":"currency","to":"inita","amount":50}' --scope currency,inita --permission currency@active +./eosc push message currency transfer '{"from":"currency","to":"inita","amount":50}' --scope currency,inita --permission currency@active ``` As a confirmation of a successfully submitted transaction you will get a json with a `transaction_id` field. @@ -445,7 +435,7 @@ As a confirmation of a successfully submitted transaction you will get a json wi ## Running local testnet -To run a local testnet you can use a `launcher` application provided in `~/eos/build/programs/launcher` folder. +To run a local testnet we can use a `launcher` application provided in `~/eos/build/programs/launcher` folder. For testing purposes we will run 2 local production nodes talking to each other. @@ -474,7 +464,7 @@ To confirm the nodes are running, run following `eosc` commands: ./eosc -p 8889 get info ``` -For each you should get a json with a blockchain information. +For each we should get a json with a blockchain information. You can read more on launcher and its settings [here](https://github.com/EOSIO/eos/blob/master/testnet.md)