提交 78ca338b 编写于 作者: D Daniel Larimer 提交者: GitHub

Merge pull request #345 from sergmetelin/master

Remove eos-walletd, custom wallet port and language cleanup
...@@ -244,8 +244,10 @@ producer-name = initr ...@@ -244,8 +244,10 @@ producer-name = initr
producer-name = inits producer-name = inits
producer-name = initt producer-name = initt
producer-name = initu producer-name = initu
# Load the block producer plugin, so we can produce blocks # Load the block producer plugin, so you can produce blocks
plugin = eos::producer_plugin plugin = eos::producer_plugin
# Wallet plugin
plugin = eos::wallet_api_plugin
# As well as API and HTTP plugins # As well as API and HTTP plugins
plugin = eos::chain_api_plugin plugin = eos::chain_api_plugin
plugin = eos::http_plugin plugin = eos::http_plugin
...@@ -284,36 +286,25 @@ cd ~/eos/build/programs/eosd/ ...@@ -284,36 +286,25 @@ cd ~/eos/build/programs/eosd/
### Run eos-walletd and importing account key ### 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 As you've previously added `plugin = eos::wallet_api_plugin` into `config.ini`, EOS wallet will be running as a part of `eosd` process.
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.
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. 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 ```commandline
cd ~/eos/build/programs/eosc/ 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 create # Outputs a password that you need to save to be able to lock/unlock the wallet
./eosc --wallet-port 8887 wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 ./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 ### 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 ```commandline
cd ~/eos/build/programs/eosc/ cd ~/eos/build/programs/eosc/
...@@ -333,7 +324,7 @@ Save the values for future reference. ...@@ -333,7 +324,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: Run `create` command where `PUBLIC_KEY_1` and `PUBLIC_KEY_2` are the values generated by the `create key` command:
```commandline ```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. You should get a json response back with a transaction ID confirming it was executed successfully.
...@@ -358,7 +349,7 @@ You should get a response similar to this: ...@@ -358,7 +349,7 @@ You should get a response similar to this:
### Upload sample contract ### 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 ```commandline
./eosc get code currency ./eosc get code currency
...@@ -368,19 +359,19 @@ code hash: 0000000000000000000000000000000000000000000000000000000000000000 ...@@ -368,19 +359,19 @@ code hash: 0000000000000000000000000000000000000000000000000000000000000000
With an account for a contract created, you can upload a sample contract: With an account for a contract created, you can upload a sample contract:
```commandline ```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! 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 ```commandline
./eosc get code currency ./eosc get code currency
code hash: 9b9db1a7940503a88535517049e64467a6e8f4e9e03af15e9968ec89dd794975 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 ```commandline
./eosc get table currency currency account ./eosc get table currency currency account
...@@ -396,7 +387,7 @@ Next we can verify that the currency contract has the proper initial balance: ...@@ -396,7 +387,7 @@ Next we can verify that the currency contract has the proper initial balance:
### Push a message to a sample contract ### 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: Firstly, generate the keys for the account:
...@@ -409,13 +400,13 @@ cd ~/eos/build/programs/eosc/ ...@@ -409,13 +400,13 @@ cd ~/eos/build/programs/eosc/
And then create the `tester` account: And then create the `tester` account:
```commandline ```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 ```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. As a confirmation of a successfully submitted transaction you will get a json with a `transaction_id` field.
...@@ -447,7 +438,7 @@ As a confirmation of a successfully submitted transaction you will get a json wi ...@@ -447,7 +438,7 @@ As a confirmation of a successfully submitted transaction you will get a json wi
To run a local testnet you can use a `launcher` application provided in `~/eos/build/programs/launcher` folder. To run a local testnet you 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. For testing purposes you will run 2 local production nodes talking to each other.
```commandline ```commandline
cd ~/eos/build cd ~/eos/build
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册