Web platform docking with Ethereum
install MIPS based Linux header file
$CD $prjroot / kernel
$tar - xjvf linux-2.6.38. Tar. Bz2
$CD linux-2.6.38
create an include folder under the specified path to store related header files< br />$ mkdir -p $TARGET_ Prefix / include
ensures that the Linux source code is clean
$make mrproper
generates the required header file< br />$ make ARCH=mips headers_ check
$ make ARCH=mips INSTALL_ HDR_ PATH=dest headers_ Install
all the files in dest folder to the specified include folder< br />$ cp -rv dest/include/* $TARGET_ Prefix / include
delete dest folder at last
$RM - RF dest
$LS - L $target_ PREFIX/include
If you want to query the transaction records on the main network, you can use Etherscan. However, if you build your own private chain, how should you query the transaction records
the answer is that you need to listen to the logs on the chain, save them in the database, and then query them in the database. For example:
< pre t = "code" L = "Java" > varaddr = & quot& quot;< br />varfilter=web3.eth.filter({fromB lock:0 ,toBlock:' latest', address:addr });< br />filter.get(function(err,transactions){transactions.forEach(function(tx){
vartxInfo=web3.eth.getTransaction(tx.transactionHash);
/ / at this time, the transaction information txinfo can be stored in the database
})< br />}); Pre >
Web3. Eth. Filter() is used to monitor the log on the chain, and Web3. Eth. Gettransaction() is used to extract the information of the specified transaction. Once the transaction information is obtained, it can be stored in the database for query
recommend a practical introction, you can see: Ethereum tutorial
you can first sort out how many function points need to get data from you (summarize and count how many WebService interfaces are needed)
then confirm which parameters are needed to query one by one by WebService
write a WebService interface document and provide it to the system developers in the bank
This problem is not difficult. The first solution is very simple.
-
build a service to interact with data. Some NoSQL databases are used.
-
when the order is submitted, write it to the database through the service, and enter a queue at the same time.
-
the client takes data from the queue every 10s.
-
pay attention to the consistency of the transaction.
< / OL >
what functions do you want to realize with wechat, just to realize instruction interaction, and there is no need to be a wechat station, You just need to develop a connection to the app database for docking instructions. If you need to achieve the same page display as the app, you need to develop a micro station for assistance. If you don't have the technology, this can't be completed. You need to program in the middle.
1. Generate the server-side key
[HTML] view plain
1. Keytool - genkey - alias serverkey - keystore key ofserver. Keystore
after that, the following information will appear: (the first password: open the keystore file password, the second password is the secret key, Generally, the two passwords are the same)
export the server certificate according to the private key (export the certificate with the alias of serverkey in the certificate library monitor.keystore to the keyofserver.cer certificate file, which contains the information of the certificate subject and the public key of the certificate, excluding the private key, and can be made public.)
[HTML] view plain
1. Keytool - export - alias serverkey - keystore keyofserver. Keystore - file server. CRT
change the server certificate to, Add to the authentication certificate list of client (only public key)
[HTML] view plain
1. Keytool - Import - alias serverkey - file server. CRT - keystore trustofclient. Keystore
2: generate client key
[HTML] view plain
1. Keytool - genkey - alias clientkey - keystore keyofclient. Keystore & lt; span style=" font-size: 18px; font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);& quot;& gt; & lt;/ span> <
export the client certificate according to the private key
[HTML] view plain
1. Keytool - export - alias clientkey - keystore keyofclient. Keystore - file client. CRT
add the certificate to the server trust list
[HTML] view plain
1. Keytool - Import - alias serverkey - file client. CRT - keystore trustofserver. Keystore
2
so far, both the client and server certificates have been generated
