# Remix本地环境搭建及hello world **Published by:** [XiaoShin](https://paragraph.com/@xiaoshin/) **Published on:** 2022-03-23 **URL:** https://paragraph.com/@xiaoshin/remix-hello-world ## Content Solidity 是一门面向合约的、为实现智能合约而创建的高级编程语言。这门语言受到了 C++,Python 和 Javascript 语言的影响,设计的目的是能在以太坊虚拟机(EVM)上运行。 Remix是Solidity热门IDE,使用Remix docker + Remixd构建本地IDE,使用环境是ubuntu 20.04。 一、Pull Remix docker# 安装docker sudo apt install docker.io # pull Remix sudo docker pull remixproject/remix-ide:latest 二、安装Remixd# 安装npm sudo apt install npm # 安装remixd sudo npm install -g @remix-project/remixd 三、启动Remix# 启动 docker sudo docker run -p 10330:80 remixproject/remix-ide:latest # 创建local文件夹,并启动 remixd (10330后的/一定要加) mkdir remix-data cd remix-data sudo remixd -s ./ --remix-ide http://127.0.0.1:10330/ 四、使用Remix 启动浏览器访问 http://127.0.0.1:10330启用Remixd插件选用localhost,即之前建的remix-data文件夹 在文件夹中创建helloworld.sol四、Helloworld编译 在helloworld.sol添加代码 (不修改链上变量的函数不消耗Gas,比如pure)// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract helloworld { string Name = "tigher"; function get_name() public view returns(string memory) { return Name; } function set(string memory _value) public { Name = _value; } function puretest(string memory _name) public pure returns(string memory) { return _name; } } 使用左侧插件编译和运行。 ## Publication Information - [XiaoShin](https://paragraph.com/@xiaoshin/): Publication homepage - [All Posts](https://paragraph.com/@xiaoshin/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@xiaoshin): Subscribe to updates